<?php

namespace app\models;

use PHPUnit\Framework\MockObject\Builder\Identity;
use Yii;
use yii\web\IdentityInterface;

/**
 * This is the model class for table "member".
 *
 * @property int $id
 * @property string $member_name
 * @property string $member_email
 * @property string $member_pwd
 * @property string $member_company
 * @property string $member_job
 * @property string $member_phone
 * @property string $member_avtar
 * @property int $update_time
 * @property int $create_time
 */
class Member extends \yii\db\ActiveRecord implements IdentityInterface
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'member';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['member_name', 'member_email', 'member_pwd', 'member_phone', 'update_time', 'create_time'], 'required'],
            [['update_time', 'create_time'], 'integer'],
            [['member_name', 'member_job'], 'string', 'max' => 64],
            [['member_email', 'member_pwd'], 'string', 'max' => 32],
            [['member_company', 'member_avtar'], 'string', 'max' => 128],
            [['member_phone'], 'string', 'max' => 11],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'member_name' => 'Member Name',
            'member_email' => 'Member Email',
            'member_pwd' => 'Member Pwd',
            'member_company' => 'Member Company',
            'member_job' => 'Member Job',
            'member_phone' => 'Member Phone',
            'member_avtar' => 'Member Avtar',
            'update_time' => 'Update Time',
            'create_time' => 'Create Time',
        ];
    }

  public static function findIdentity($id)
  {
    return Member::findOne($id);
  }

  public static function findIdentityByAccessToken($token, $type = null)
  {
    return true;
  }

  public function getId()
  {
    return $this->id;
  }

  public function getAuthKey()
  {
    return true;
  }

  public function validateAuthKey($authKey)
  {
    return true;
  }
}
